ADF.util.Pair = function(key , value) {
    ADF.util.Pair.superclass.constructor.call(this);
    this.key = key ;
	this.value = value;
}

var ThisClass = ADF.util.Pair;

COM.util.defineClass(ThisClass, Object, {
	getKey : function(){
		return this.key;
	},
	
	setKey : function(key){
		this.key = key;
	},
	
	getValue : function(){
		return this.value;
	},
	
	setValue : function(value){
		this.value = value;
	}
});

///////////////////////////////////////////////////////////////////////////
ADF.util.DashedPolyline = function(dashlen , gaplen , id) {
	ADF.util.DashedPolyline.superclass.constructor.call(this, id);
	this.dashlen = dashlen;
	this.gaplen = gaplen;
};

var ThisClass = ADF.util.DashedPolyline;

COM.util.defineClass(ThisClass, COM.draw2d.Polyline, {
	outlineShape : function(graphics){
		graphics.dashedPolyline(this.points,this.dashlen,this.gaplen);
	}
});

////////////////////////////////////////////////////////////////////////////
ADF.util.LabelFeedback = function(layer , text , ico) {
    ADF.util.LabelFeedback.superclass.constructor.call(this);
    this.feedbackLayer = layer;
	this.text = text;
	this.panel = new COM.draw2d.Figure();
	this.panel.setBorder(new COM.draw2d.CompoundBorder(new COM.draw2d.LineBorder(), new COM.draw2d.MarginBorder(0, 2, 0, 2)));
	//��������
	this.panel.setFont();
	// this.panel.setBackgroundColor(COM.draw2d.ColorConstants.red);
	//���ò���
	this.panel.setLayoutManager(new COM.draw2d.XYLayout());
	this.label = new COM.draw2d.Label();
	this.label.setOpaque(true);
	this.label.setForegroundColor(COM.draw2d.ColorConstants.black);
	this.label.setText(text);
	// this.label.setBackgroundColor(COM.draw2d.ColorConstants.yellow);
	if(ico){
		this.label.setIcon(ico);
	}
	this.panel.add(this.label , new COM.draw2d.Rectangle(0,0,-1,-1));
	this.updatePanelSize(); 

	this.feedbackLayer.add(this.panel);
}

var ThisClass = ADF.util.LabelFeedback;

COM.util.defineClass(ThisClass, Object, {
	// getFor : function(host){
	// 	return new UIXYLayoutEditPolicy();
	// },
	
	updatePanelSize : function(){
		this.panel.validate();
		this.size = this.panel.getPreferredSize();
		this.panel.setSize(this.size);

		// this.label.setBorder(new COM.draw2d.LineBorder());
		// this.label.setSize(new COM.draw2d.Dimension(100, 28));
		// this.panel.setSize(new COM.draw2d.Dimension(100, 30));
	},
	
	setText : function(text){
		this.label.setText(text);
		this.updatePanelSize();
	},
	
	setBackgroundColor : function(color){
		this.panel.setBackgroundColor(color);
	},
	
	setIcon : function(icon){
		this.label.setIcon(icon);
		this.updatePanelSize();
	},
	
	getFigure : function(){
		return this.panel;
	},

	getLabel : function(){
		return this.label;
	}
	
});